<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<link href="<s:url value="/css/style.css"/>" rel="stylesheet"
			type="text/css" />
		<script type="text/javascript" src="<s:url value="/js/jquery.js"/>"></script>
		<script type="text/javascript" src="<s:url value="/js/common.js"/>"></script>
		<script type='text/javascript'
			src="<s:url value="/js/tableSel.js"/>"></script>
		<script type="text/javascript">
function dosubmit(){

	$('#listForm').submit();
}
function goEdit(){
	location.href='<s:url value="/contract/Contract/edit"/>';
}
function goDelete(form){
	form = document.getElementById('listForm');
	var ids = getSelectionIds('a');
	if(ids.length<1){
		alert('Please select one at least.');
	}else{
		form.action=form.action.replace('list','delete');
		$('#ids').val(ids);
		 
		form.submit();
	}
}
function changedisplay(el){
	el.toggle("fast",function() {
		//$Container.getContainerProxy().resize();
	});
}
</script>
		<title><s:text name="system.title" />
		</title>
	</head>
	<body>
		<s:include value="/common/up.jsp"></s:include>
		<table width="100%" border="0" cellspacing="0" cellpadding="0">
			<tr>
				<td class="box">
					<s:form action="PersonalPay/list" name="listForm" id="listForm"
						namespace="/finance">
						<input type="hidden" id="startIndex" name="startIndex" value="0" />
						<s:hidden name="ids" id="ids" />
						<table width="100%" border="0" cellpadding="0" cellspacing="0"
							class="searchbg">
							<tr>
								<td>
									&nbsp;Name :
									<s:textfield name="leadsName" cssClass="input2" size="8" />
									&nbsp;Tel:
									<s:textfield name="leadsTel" cssClass="input2" size="13" />
									&nbsp;Contract No:
									<s:textfield name="contractNo" cssClass="input2" size="13" />
									<img src="<s:url value="/img/right/btns.gif"/>" border="0"
										align="absmiddle" onclick="javascript:dosubmit();" />
									&nbsp;
						    	</td>
							</tr>
						</table>
						<table width="100%" border="0" cellpadding="0" cellspacing="1"
							class="box2 activeTable">
							<tr>
								<td width="33" class="tablecolour1">
									<input type="checkbox" name="all" onclick="checkAll('a',this)" />
								</td>
								<td class="tablecolour1">
									Name
								</td>
								<td class="tablecolour1">
									Mobile
								</td>
								<td class="tablecolour1">
									Contract No
								</td>
								<td class="tablecolour1">
									TM
								</td>
								<td class="tablecolour1">
									CC
								</td>
								<td class="tablecolour1">
									Commit Time
								</td>
								<td class="tablecolour1">
									Price
								</td>
								<td class="tablecolour1">
									Pay Status
								</td>
								<td class="tablecolour1">
									Paid Money
								</td>
								<td class="tablecolour1">
									Type
								</td>
								<td class="tablecolour1">
									Level
								</td>
								<td class="tablecolour1" nowrap="nowrap">
									Begin
								</td>
								<td class="tablecolour1">
									Function
								</td>
							</tr>
							<s:iterator value="listResult.items" status="status">
								<tr>
									<td class="tablecolour2">
										<input type="checkbox" name="a"
											value="<s:property value="id" />" />
									</td>
									<td class="tablecolour2">
										<s:property value="leads.name" />
									</td>
									<td class="tablecolour2">
										<s:property value="leads.mobileTelephone" />
									</td>
									<td class="tablecolour2">
										<s:property value="contractNo" />
									</td>
									<td class="tablecolour2">
										<s:property value="leads.tm.name" />
									</td>
									<td class="tablecolour2">
										<s:property value="leads.cc.name" />
									</td>
									<td class="tablecolour2">
										<s:date name="commitTime" format="yyyy-MM-dd"/>
									</td>
									<td class="tablecolour2">
										<s:property value="price" />
									</td>
									<td class="tablecolour2">
										<s:property value="payMethod" />
									</td>
									<td class="tablecolour2">
										<s:property value="paidMoney" />
									</td>
									<td class="tablecolour2">
										<s:property value="contractStateMsg" />
									</td>
									<td class="tablecolour2">
										<s:property value="beginLevel.name" />
									</td>
									<td class="tablecolour2">
										<s:date name="startTime" format="yyyy-MM-dd" />
									</td>
									<td class="tablecolour2">
									    <s:if test="needPay()">
										<a
											href='<s:url value="/finance/PersonalPay/edit?id="/><s:property value="id"/>'>Pay</a>
									    </s:if>
									    <s:elseif test="contractStateMsg!='FINISHED'&&contractStateMsg!='NEW'">
									    	<a
											href='<s:url value="/finance/PersonalPay/edit?id="/><s:property value="id"/>'>Refund</a>
									    </s:elseif>
										<a
											href='<s:url value="/finance/PersonalPay/view?id="/><s:property value="id"/>'>View</a>
									</td>
								</tr>
							</s:iterator>
						</table>
						<s:include value="/common/page.jsp"></s:include>
					</s:form>
				</td>
			</tr>
		</table>
		<s:include value="/common/down.jsp"></s:include>
	</body>
</html>